let help = require("../../config/help");
const utils = require('../../utils/util.js')
// pages/help/help.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list: help.list
  },
  toggleState(event){
    let touchIndex = event.currentTarget.dataset.index;
    let list = help.list.map((item, index) => {
      if (index == touchIndex){
        item.show = !item.show
      }else{
        item.show = false;
      }
      return item;
    });
    this.setData({
      list
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  ...utils.defaultShare,
  onReady: function () {
    wx.showShareMenu();
    let list = help.list.map((item) => {
      item.show = false;
      return item;
    });
    console.log(list)
    this.setData({
      list
    })
  },

})